<script>
document.write(function sumEvenFibis(i1,i2,upper) {
	var s = i1 + i2;
	if (s < upper) {
		if(s%2 === 0) {
			s += sumEvenFibis(i2, s, upper);
		} else {
			s = sumEvenFibis(i2, s, upper);
		}
	} else {
		s = 2;
	}
	return s;
}(1,2,4000000));
</script>